package br.com.ctp.dao;

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class Insert {

	public static void main(String[] argv) {
		try {
			insertRecordIntoTable();
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}
	}

	public static void insertRecordIntoTable() throws SQLException {
		
		Connection dbConnection = null;
		PreparedStatement preparedStatement = null;

		String insertTableSQL = " INSERT INTO tb_usuario values (9,'s','jonasbastos.j@gmail.com','ABC','teste',123) ";

		try {
			dbConnection = Connect.getDBConnection();
			preparedStatement = dbConnection.prepareStatement(insertTableSQL);
			preparedStatement.executeUpdate();
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		} finally {
			if (preparedStatement != null) {
				preparedStatement.close();
			}
			if (dbConnection != null) {
				dbConnection.close();
			}
		}
	}

}